package cn.tedu.egvehicle02.base.config;

import cn.tedu.egvehicle02.base.interceptor.LoginCheckInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        WebMvcConfigurer.super.addInterceptors(registry);
        registry.addInterceptor(new LoginCheckInterceptor())
                .addPathPatterns("/v1/user/currentUser")
                .addPathPatterns("/v1/user/logout")
                .addPathPatterns("/v1/vehicle/**");
    }
}
